home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20021006-20030409 / 000310_fdc@columbia.edu_Sat Feb 15 15:29:16 EST 2003.msg < prev    next >
Text File  |  2020-01-01  |  4KB  |  117 lines

  1. Article: 14106 of comp.protocols.kermit.misc
  2. Path: newsmaster.cc.columbia.edu!news.columbia.edu!news-not-for-mail
  3. From: fdc@columbia.edu (Frank da Cruz)
  4. Newsgroups: comp.unix.admin,comp.unix.programmer,comp.protocols.kermit.misc
  5. Subject: Re: Listing Files with full date
  6. Date: 15 Feb 2003 15:24:56 -0500
  7. Organization: Columbia University
  8. Lines: 100
  9. Message-ID: <b2m7mo$qil$1@watsol.cc.columbia.edu>
  10. References: <b2ja2g$pq3$2@reader1.panix.com> <v4r81bm1h4vh35@corp.supernews.com>
  11. NNTP-Posting-Host: watsol.cc.columbia.edu
  12. X-Trace: newsmaster.cc.columbia.edu 1045340697 15990 128.59.39.139 (15 Feb 2003 20:24:57 GMT)
  13. X-Complaints-To: postmaster@columbia.edu
  14. NNTP-Posting-Date: 15 Feb 2003 20:24:57 GMT
  15. Xref: newsmaster.cc.columbia.edu comp.unix.admin:148899 comp.unix.programmer:158863 comp.protocols.kermit.misc:14106
  16.  
  17. Jane O <janeohin@aol.com> wrote:
  18. > How can I list files so that the "year" shows up instead of just
  19. > Month, day, time
  20.  
  21. > 16757 Feb 10 15:44  abc.proc*
  22. >  9435 Jan 24 13:29  def.proc*
  23. >  8639 Jan 30 13:23  xyz.proc
  24. >
  25. Believe it or not, you can use Kermit for this; it has a rather
  26. featureful DIRECTORY command.  Here's a small directory as seen
  27. by ls -lG:
  28.  
  29.   $ ls -lG
  30.   total 124
  31.   -rw-rw----   1 fdc          2962 Dec 22  1999 archive.txt
  32.   -rw-rw----   1 fdc          5934 Jan 12  1990 ascii.tbl
  33.   -rw-rw----   1 fdc         15317 Sep 20  2000 sail.txt
  34.   -rw-rw----   1 fdc         89237 Aug  2  1988 yacc.txt
  35.   -rw-rw----   1 fdc          2180 Feb  8 15:29 webpages.txt
  36.   $
  37.  
  38. And as seen by Kermit:
  39.  
  40.   C-Kermit> dir
  41.   -rw-rw----      2962  1999-12-22 15:08:34  archive.txt
  42.   -rw-rw----      5934  1990-01-12 14:17:47  ascii.tbl
  43.   -rw-rw----     15317  2000-09-20 10:55:31  sail.txt
  44.   -rw-rw----     89237  1988-08-02 21:22:02  yacc.txt
  45.   -rw-rw----      2180  2003-02-08 15:29:48  webpages.txt
  46.   C-Kermit>
  47.  
  48. The dates are yyyy-mm-dd by default, but if you wish you show them
  49. the "English" way:
  50.  
  51.   C-Kermit> dir /englishdate
  52.   -rw-rw----      2962  22-Dec-1999 15:08:34  archive.txt
  53.   -rw-rw----      5934  12-Jan-1990 14:17:47  ascii.tbl
  54.   -rw-rw----      2180   8-Feb-2003 15:29:48  webpages.txt
  55.   -rw-rw----     15317  20-Sep-2000 10:55:31  sail.txt
  56.   -rw-rw----     89237   2-Aug-1988 21:22:02  yacc.txt
  57.   C-Kermit>
  58.  
  59. You can sort them by date:
  60.  
  61.   C-Kermit> dir /sort:date
  62.   -rw-rw----     89237  1988-08-02 21:22:02  yacc.txt
  63.   -rw-rw----      5934  1990-01-12 14:17:47  ascii.tbl
  64.   -rw-rw----      2962  1999-12-22 15:08:34  archive.txt
  65.   -rw-rw----     15317  2000-09-20 10:55:31  sail.txt
  66.   -rw-rw----      2180  2003-02-08 15:29:48  webpages.txt
  67.   C-Kermit>
  68.  
  69. Or in reverse order by date:
  70.  
  71.   C-Kermit> dir /sort:date /reverse
  72.   -rw-rw----      2180  2003-02-08 15:29:48  webpages.txt
  73.   -rw-rw----     15317  2000-09-20 10:55:31  sail.txt
  74.   -rw-rw----      2962  1999-12-22 15:08:34  archive.txt
  75.   -rw-rw----      5934  1990-01-12 14:17:47  ascii.tbl
  76.   -rw-rw----     89237  1988-08-02 21:22:02  yacc.txt
  77.   C-Kermit>
  78.  
  79. (or by size, or by name, etc).  You can write the results to a file,
  80. store it in an array, etc.  There are tons more options too:
  81.  
  82.   C-Kermit> dir ? Enter or Return to confirm the command, or
  83.    file specification, or switch, one of the following:
  84.    /after:       /dotfiles     /message:       /nosort      /smaller-than:
  85.    /all          /englishdate  /nobackupfiles  /not-after:  /sort:
  86.    /array:       /except:      /nodotfiles     /not-before: /summary
  87.    /ascending    /files        /nofollowlinks  /noxfermode  /type:
  88.    /backup       /heading      /noheading      /output:     /xfermode
  89.    /before:      /isodate      /nomessage      /page        /verbose
  90.    /brief        /larger-than: /nopage         /recursive
  91.    /directories  /followlinks  /norecursive    /reverse
  92.   C-Kermit>
  93.  
  94. ("help directory" for details).  Many of these same options are available
  95. on other file-related commands such as SEND, GET, DELETE, etc.  So, to
  96. answer the commonly asked question, "How do I delete files that are more
  97. than five days old?":
  98.  
  99.   C-Kermit> delete /before:-5days *
  100.  
  101. : > I need to compare the files dates !
  102. Kermit has a command for this:
  103.  
  104.   if newer <file1> <file2> <command>
  105.  
  106. It also has all sorts of date conversion, comparison, and arithmetic
  107. functions:
  108.  
  109.   http://www.columbia.edu/kermit/ckermit80.html#x8.13
  110.  
  111. You can find Kermit here:
  112.  
  113.   http://www.columbia.edu/kermit/
  114.  
  115. - Frank
  116.